package appconfig

import "github.com/spf13/viper"

type Mysql struct {
	Host     string
	Port     int
	User     string
	Password string
	Database string
}
type AppConfig struct {
	Mysql
}

var Config AppConfig

func Init() {
	viper.SetConfigFile("appconfig/dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		panic(err)
	}
	err = viper.Unmarshal(&Config)
	if err != nil {
		panic(err)
	}
}
